<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>党建后台</title>
    <meta name="keywords"  />
    <meta name="description"  />
    <link rel="stylesheet" type="text/css" href="/dangjian/Public/layui/css/layui.css" />
    <link rel="stylesheet" type="text/css" href="/dangjian/Public/bootstrap/css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="/dangjian/Public/Admin/Css/identify.css" />
    <link rel="stylesheet" type="text/css" href="/dangjian/Public/Admin/Css/layout.css" />
    <link rel="stylesheet" type="text/css" href="/dangjian/Public/Admin/Css/account.css" />
    <link rel="stylesheet" type="text/css" href="/dangjian/Public/Admin/Css/style.css" />
    <link rel="stylesheet" type="text/css" href="/dangjian/Public/Admin/Css/control_index.css" />
    <link rel="stylesheet" type="text/css" href="/dangjian/Public/Admin/Css/index.css" />

    <link rel="stylesheet" type="text/css" href="/dangjian/Public/Admin/Css/page.css" />

    <script type="text/javascript" src="/dangjian/Public/Admin/Js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="/dangjian/Public/layui/layui.js"></script>
    <script type="text/javascript" src="/dangjian/Public/Admin/Js/layer/layer.js"></script>
    <script type="text/javascript" src="/dangjian/Public/Admin/Js/haidao.offcial.general.js"></script>
    <script type="text/javascript" src="/dangjian/Public/Admin/Js/select.js"></script>
    <script type="text/javascript" src="/dangjian/Public/Admin/Js/haidao.validate.js"></script>

    <script type="text/javascript" charset="utf-8" src="/dangjian/Public/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/dangjian/Public/ueditor/ueditor.all.min.js"> </script>
    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8" src="/dangjian/Public/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>

<body>

    <!--<div class="view-product" style="margin-top: 50px">-->
    <div class="info-center">
        <div class="manage-head">
            <h6 class="padding-left manage-head-con"><?php echo ($title); ?></h6>
        </div>
        <div class="offcial-table input-table table-margin clearfix">
            <div class="demoTable">
                <form action="<?php echo U('Application/index');?>" method="get">
                    作者：
                    <div class="layui-inline">
                        <input class="layui-input" name="name"  autocomplete="off">
                    </div>
                    &nbsp;时间：
                    <div class="layui-inline">
                        <input class="layui-input" style="width: 200px" name="time" id="test1"  autocomplete="off">
                    </div>
                    &nbsp;状态：
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <select name="status" lay-search="" class="form-control">
                                <option value="">所有</option>
                                <option value="2">待审核</option>
                                <option value="1">已审批</option>
                            </select>
                        </div>
                    </div>
                    &nbsp;排序：
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <select name="order" lay-search="" class="form-control">
                                <option value="a.id" selected>ID</option>
                                <option value="a.applica_time">申请时间</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <select name="order1" lay-search="" class="form-control">
                                <option value="asc" selected>正序</option>
                                <option value="desc">倒序</option>
                            </select>
                        </div>
                    </div>

                    <input type="submit" value="搜索" class="layui-btn">
                </form>
            </div>
            <?php if($appList == null): ?><div class="tr non-info show border-bottom-none">
                    <span>没查询到符合条件的记录</span>
                </div>
                <?php else: ?>
                <table class="layui-table text-center">
                    <colgroup>
                        <col width="5%">
                        <col width="10%">
                        <col width="35%">
                        <col width="10%">
                        <col width="10%">
                        <col width="10%">
                        <col width="10%">
                        <col width="10%">
                    </colgroup>
                    <tr>
                        <th class="text-center">ID</th>
                        <th class="text-center">申请人</th>
                        <th class="text-center">转至支部</th>
                        <th class="text-center">申请时间</th>
                        <th class="text-center">申请状态</th>
                        <th class="text-center">审批人</th>
                        <th class="text-center">审批时间</th>
                        <th class="text-center">党费缴纳至</th>
                    </tr>
                    <?php if(is_array($appList)): foreach($appList as $k=>$vo): ?><tr onclick="showDetail(this)">
                            <td><?php echo ($vo["id"]); ?></td>
                            <td><?php echo ($vo["name"]); ?></td>
                            <td><?php echo ($vo["department"]); ?></td>
                            <td><?php echo substr($vo['applica_time'],0,10);?></td>
                            <td><?php echo ($vo['applica_status']==0 ? "待审核" : "已审批"); ?></td>
                            <td><?php echo ($vo["approve_name"]); ?></td>
                            <td>
                                <?php if(($vo["approve_time"]) == "0000-00-00 00:00:00"): else: echo substr($vo['approve_time'],0,10); endif; ?>
                                </td>
                            <td><?php echo substr($vo['fee_time'],0,7);?></td>
                        </tr><?php endforeach; endif; ?>
                    <tr>
                        <td colspan="8"><div class="sabrosus"><?php echo ($page); ?></div></td>
                    </tr>
                </table><?php endif; ?>

        </div>
    </div>
    <!--</div>-->
    <script>
        layui.use('laydate', function() {
            var laydate = layui.laydate;
            //年选择器
            laydate.render({
                elem: '#test1'
                ,range: true
            });
        });
        function showDetail(obj){
            var id = $(obj).find("td").eq(0).text();
            $.ajax({
                type : "get",
                data : {id:id},
                dataType : "json",
                url : "<?php echo U('Application/queryInfoById');?>",
                success : function(msg){

                    if(msg['approve_time'] == "0000-00-00 00:00:00"){
                        msg['approve_time'] = "";
                    }
                    // console.log(msg['approve_name']);
                    if(msg['approve_name'] === null){
                        msg['approve_name'] = ""
                    }
                    if(msg['applica_status'] == 0){
                        msg['applica_status'] = "未审核"
                    }else{
                        msg['applica_status'] = "已审批"
                    }
                    layui.use("layer",function(){
                        var layer = layui.layer;
                        //示范一个公告层
                        layer.open({
                            type: 1
                            ,title: false //不显示标题栏
                            ,closeBtn: false
                            ,shade : 0
                            ,area: '500px;'

                            ,id: 'LAY_layuipro' //设定一个id，防止重复弹出
                            ,btn: ['确定']
                            ,btnAlign: 'c'
                            ,moveType: 1 //拖拽模式，0或者1
                            ,content: '<div style="padding: 30px; line-height: 30px; background-color: #393D49; color: #fff; font-weight: 300;font-size: 20px">' +
                            '姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名:&nbsp;&nbsp;&nbsp;'+msg['name']+
                            '<br>电&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;话:&nbsp;&nbsp;&nbsp;'+msg['tel']+
                            '<br>身份证号:&nbsp;&nbsp;&nbsp;'+msg['card_num']+
                            '<br>转出支部:&nbsp;&nbsp;&nbsp;'+msg['out_department']+
                            '<br>转入支部:&nbsp;&nbsp;&nbsp;'+msg['department']+
                            '<br>申请时间:&nbsp;&nbsp;&nbsp;'+msg['applica_time'].substring(0,10)+
                            '<br>审批状态:&nbsp;&nbsp;&nbsp;'+msg['applica_status']+
                            '<br>审&nbsp;批&nbsp;&nbsp;人:&nbsp;&nbsp;&nbsp;'+msg['approve_name']+
                            '<br>审批时间:&nbsp;&nbsp;&nbsp;'+msg['approve_time']+
                            '<br>入党时间:&nbsp;&nbsp;&nbsp;'+msg['join_time'].substring(0,10)+
                            '<br>党费缴至:&nbsp;&nbsp;&nbsp;'+msg['fee_time'].substring(0,7)+
                            '</div>'

                        });
                    })
                }

            })
        }
    </script>

<script>
    function iFrameHeight(f) {
        // f.src
        // var iframeWindow = document.getElementById('iframepage').contentWindow;
        // var currentHref = iframeWindow.document.location.href;
        // console.log(currentHref);
        var ifm= document.getElementById("iframepage");
        var subWeb = document.frames ? document.frames["iframepage"].document : ifm.contentDocument;
        if(ifm != null && subWeb != null) {
            ifm.height = subWeb.body.scrollHeight;
            ifm.width = subWeb.body.scrollWidth;
        }
    }

    function prev(){
        window.location.href = document.getElementById('iframepage').previousSrc;
    }
    // window.location.replace($("#iframepage").src());
    // window.location.href = $("#iframepage").src();
    // var ifm= document.getElementById("iframepage");
    // ifm.height=document.documentElement.clientHeight;
    $(".sidebar-title").live('click', function() {
        if ($(this).parent(".sidebar-nav").hasClass("sidebar-nav-fold")) {
            $(this).next().slideDown(200);
            $(this).parent(".sidebar-nav").removeClass("sidebar-nav-fold");
        } else {
            $(this).next().slideUp(200);
            $(this).parent(".sidebar-nav").addClass("sidebar-nav-fold");
        }
    });
</script>
</body>

</html>